import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [

  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '@/views/login/index.vue')
  },
  {
    path: '/',
    component: () => import(/* webpackChunkName: "home" */ '@/views/layout/index.vue'),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import(/* webpackChunkName: 'Home' */'@/views/home/index')
      },
      {
        path: '/market',
        name: 'market',
        component: () => import(/* webpackChunkName: 'market' */'@/views/market/index')
      },
      {
        path: '/collection',
        name: 'collection',
        component: () => import(/* webpackChunkName: 'collection' */'@/views/collection/index')
      },
      {
        path: '/user',
        name: 'user',
        component: () => import(/* webpackChunkName: 'collection' */'@/views/user/index'),
        children: [
          {
            path: '/owned',
            name: '/owned',
            component: () => import(/* webpackChunkName: 'owned' */'@/views/user/components/owned')
          },
          {
            path: '/sold',
            name: '/sold',
            component: () => import(/* webpackChunkName: 'sold' */'@/views/user/components/sold')
          },
          {
            path: '/molten',
            name: '/molten',
            component: () => import(/* webpackChunkName: 'molten' */'@/views/user/components/molten')
          },
          {
            path: '/records',
            name: '/records',
            component: () => import(/* webpackChunkName: 'records' */'@/views/user/components/records')
          }
        ]
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
